<template>
	<view class="container">
		<view class="tui-page__bd">
			<view class="tui-title">{{time}}各店门票营业额（单位：元）</view>
			<view class=".charts-box">
				<qiun-data-charts type="bar" :opts="{xAxis:{max:max}}" :chartData="options1" />

			</view>

		</view>
	</view>
</template>

<script>
	import {
		ticketSales
	} from '@/api/analysis.js'

	export default {
		data() {
			return {
				max: 50,
				time: Date.now(),
				options1: {
					categories: [],
					series: [{
						"name": "营业额",
						"data": []
					}]
				}
			}
		},
		onLoad() {
			this.ticketSales();
		},
		methods: {
			ticketSales() {
				ticketSales().then(res => {
					this.options1.categories = res.data.depts;
					this.max = res.data.max;
					this.time = res.data.time;
					this.options1.series[0].data = res.data.dataset;
				}).catch(res => {
					that.$util.Tips({
						title: res
					});
				});
			}
		}
	}
</script>

<style>
	.tui-title {
		width: 100%;
		font-size: 28rpx;
		color: #888;
		padding: 80rpx 0 30rpx;
		box-sizing: border-box;
		text-align: center;
	}
	.charts-box {
		width: 100%;
		height: 300px;
	}
</style>
